<style>
html{
    height: -webkit-fill-available;
}
.fui-content {
   background: url("/addons/jy_xiuvote/resource/bg.jpg") no-repeat #79557b;
   background-size: cover;
   height: 100%;
}
.weui_cells {
   background:none
}
.weui_cells_title {
    color: #fff;
}
.weui_cells:before {
  height: 0;
}
.weui_cells:after {
	height: 0;
	border-bottom: 0 solid #D9D9D9;
}
</style>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='main'" style="background:none">
	<div class="fui-content" style="padding-bottom:3.5rem;">
	<div class="c">
		<img style="width:5rem;padding-top:1rem" ng-src="{{tomedia(pagedata.basic.sublogo)||'/addons/jy_xiuvote/resource/sublogo.png'}}"/>
	</div>
	<div class="weui_cells weui_cells_form" style="background:none;padding:0 1rem;">
		<div class="weui_cells_title">姓名</div>
		<div class="weui_cell weui_vcode">
			<div class="weui_cell_bd weui_cell_primary" style="padding:0">
				<input class="weui_input" type="text" ng-model="pagedata.post.realname" value="{{pagedata.post.realname}}" placeholder="请输入您的姓名">
			</div>
		</div>
		<div class="weui_cells_title">年龄</div>
		<div class="weui_cell weui_vcode">
			<div class="weui_cell_bd weui_cell_primary" style="padding:0">
				<input class="weui_input" type="text" ng-model="pagedata.post.age" value="{{pagedata.post.age}}" placeholder="请输入您的年龄">
			</div>
		</div>
		<div class="weui_cells_title">电话</div>
		<div class="weui_cell weui_vcode">
			<div class="weui_cell_bd weui_cell_primary" style="padding:0">
				<input class="weui_input" type="text" ng-model="pagedata.post.mobile" value="{{pagedata.post.mobile}}" placeholder="请输入您的电话">
			</div>
		</div>
		<div class="weui_cells_title">介绍<span style="font-size:0.45rem">(50字内)</span></div>
		<div class="weui_cell weui_vcode">
			<div class="weui_cell_bd weui_cell_primary" style="padding:0">
				<textarea class="weui_textarea" style="border-radius:0.2rem" ng-model="pagedata.post.description" value="{{pagedata.post.description}}" placeholder="请输入您的参赛作品说明" rows="3"></textarea>
			</div>
		</div>
	</div>
	<div class="fui-cellone">
        <div class="fui-cellone-text c">
			<div style="color:#fff;font-size:0.7rem">上传个人照片<span style="font-size:0.45rem">(大小不超过10M)</span></div>
			<div style="padding:0 0.5rem">
			<img ng-if="pagedata.post.thumb" style="height:5rem" ng-click="up_file(pagedata.post,'thumb','image')" accept="image/jpg,image/jpeg,image/png,image/gif" ng-src="{{tomedia(pagedata.post.thumb)}}"/>
			<div ng-if="!pagedata.post.thumb" ng-click="up_file(pagedata.post,'thumb','image')" style="margin-top:0.5rem;border: 1px dashed #e7e7eb;height:5rem;padding:1rem 0;text-align:center;">
					<i class="icon icon-tianjia" style="font-size:2rem;color:#fff"></i>
			</div>
			</div>
		</div>
		<div class="fui-cellone-text c">
			<div style="color:#fff;font-size:0.7rem">上传才艺视频<span style="font-size:0.45rem">(大小不超过420M)</span></div>
			<div style="padding:0 0.5rem">
			<video ng-if="pagedata.post.video" ng-poster="{{tomedia(pagedata.post.thumb)}}" style="height:5rem"  x5-playsinline="" playsinline="" webkit-playsinline="" poster="" preload="auto">
				<source ng-src="{{tomedia(pagedata.post.video)}}" type="video/mp4">
			</video>
			<div ng-if="!pagedata.post.video" ng-click="choose_source(pagedata.post,'video','video')" style="margin-top:0.5rem;border: 1px dashed #e7e7eb;height:5rem;padding:1rem 0;text-align:center;">
				<i class="icon icon-tianjia" style="font-size:2rem;color:#fff"></i>
			</div>
			</div>
		</div>
	</div>
	<div class="c">
		<img style="width:7rem" ng-click="pagedata.setvote()" ng-src="{{tomedia(pagedata.basic.subimg)||'/addons/jy_xiuvote/resource/sub.png'}}"/>
	</div>
</div>
<div ng-if="pagedata.ispost" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<div class="fui-content radius" style="padding-bottom:3.5rem;">
			<div class="c">
				<img style="width:5rem;padding-top:1rem" ng-src="{{tomedia(pagedata.basic.sublogo)||'/addons/jy_xiuvote/resource/sublogo.png'}}"/>
			</div>
			<div class="c">
				<span style="color:#fff;font-size:1.6rem">
					报名成功
				</span>
			</div>
			<div class="c">
				<div style="color:#fff;font-size:0.65rem">
					恭喜佳人报名成功
				</div>
				<div style="color:#fff;font-size:0.65rem">
					关注官方公众号 静候佳音
				</div>
				<div style="color:#fff;font-size:0.65rem">
					9月13日官方公布海选通过名单
				</div>
				<div style="color:#fff;font-size:0.65rem">
					期待你的到来
				</div>
			</div>
			<div class="c" style="padding-top:0.5rem">
				<img style="width:8rem" ng-click="access_json('jy_xiuvote/r_detail//id='+pagedata.reply.id);" ng-src="{{tomedia(pagedata.basic.toindex)||'/addons/jy_xiuvote/resource/toindex.png'}}"/>
			</div>
		</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('_itemfooter')"></div>
</div>
<script>
//提交
scope.pagedata.setvote=function(msg){
	if(scope.pagedata.reply.price >0 && !scope.pagedata.post.id){
		var complete_url='/upfeelog/'
		scope.pagedata.post.price=scope.pagedata.reply.price;
		scope.post_json('/upopus/post/',scope.pagedata.post,function(result){
			scope.pagedata.order_id=result.order_id;
			var success_url=result.success_url?result.success_url:complete_url
			var error_url=result.error_url?result.error_url:complete_url
			scope.$evalAsync();
			scope.tool.pay(result.pay_id,function(res){
					if(res.type=='success'){
						scope.pagedata.ispost=true;
						scope.message('发布成功！');
						scope.$evalAsync();
					}else{
						scope.message('发布失败！');
					}
			},'','',success_url,error_url);
		});
	}else{
		scope.post_json('/upopus/post/',scope.pagedata.post,function(result){
			scope.pagedata.ispost=true;
			scope.$evalAsync();
		});
	}
}
scope.pagedata.getfileds = function(id){
		var params = {
					'plugin':'jy_xiuvote',
					'action':'upopus',
					'op':'getfileds',
					'query':'id='+id,
					'data':{},
					'callback':function(data){
							//console.log(data)
							if(data.success == 1){
								scope.pagedata.post.fileds = data.post.fileds;
								scope.$evalAsync();
							}
					}
		}
		scope.post_json(params);
}
scope.pagedata.up_file=function(index){
	if(index){
		scope.choose_source(scope.pagedata.post.fileds[index],['data','thumb'],'video');
	}else{
		scope.choose_source(scope.pagedata.post,['video','thumb'],'video');
	}
}
</script>